package com.color.admin.common.core.constant;

import java.util.HashMap;
import java.util.Map;

/**
 * @author HaiQiu
 * @date 2021/12/9
 * 常量集合
 */
public class Constant {


    /********************** 增删改查 **************************/
    public static final String INSERT = "新增成功";
    public static final String INSERT_FAIL = "新增失败";
    public static final String UPDATE = "修改成功";
    public static final String UPDATE_FAIL = "修改失败";
    public static final String DELETE = "删除成功";
    public static final String SELECT = "查询成功";
    public static final String RESET = "重置成功";
    public static final String DELETE_FAIL = "删除失败,数据不存在";
    public static final String ID_EXITS = "数据ID不能为空";
    public static final String DATA_EXITS = "数据不存在";
    public static final String PARAMS_EXITS = "参数不能为空";
    public static final String OCCUPY = "这些用户：%s正在使用该%s，请手动取消关联";
    public static final String NOT_EMPTY = "不能为空";


    /********************** 操作 **************************/
    public static final String OPERATION = "成功%s%d条数据";



    /********************** 开放接口 **************************/

    //放行Api
    public static final Map<String, String> ALLOW_APIS = new HashMap<>();

    static {
        ALLOW_APIS.put("/auth/authorized/test", "GET");
        ALLOW_APIS.put("/auth/authorization/login", "POST");
        ALLOW_APIS.put("/auth/authorization/captcha/check", "POST");
        ALLOW_APIS.put("/auth/authorization/captcha/get", "POST");
    }



    /********************** 系统常量配置 **************************/

    //性别：0男，1女，2保密
    public static final int SEX_MAN = 0;
    public static final int SEX_WOMAN = 1;
    public static final int SEX_SECRET = 2;

    //status状态：0正常，1冻结
    public static final int STATUS_ENABLE = 0;
    public static final int STATUS_DISABLE = 1;

    //active激活：true激活，false禁用
    public static final boolean ACTIVE_ENABLE = true;
    public static final boolean ACTIVE_DISABLE = false;

    //管理员用户名
    public static final String ADMIN = "admin";

    //本机地址
    public static final String LOCALHOST = "127.0.0.1";

    /****************************** redis缓存热键 *******************************/

    //用户菜单权限
    public static final String USER_SECURITY = "user:security:";
    public static final String USER_AUTH = "user:auth:";
    public static final String USER_ERROR = "user:error:";
    public static final String USER_LOGIN_ERROR = "user:login:error:";

    /****************************** 字段排序 *******************************/
    public static final String DESC = "desc";
    public static final String ASC = "asc";
}
